-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature][connector-v2] add tablestore source and sink #3309
Conversation
c0cf8b5
to
da7490e
Compare
|
# Conflicts: # seatunnel-connectors-v2/pom.xml
sink connector test conf
|
# Conflicts: # plugin-mapping.properties
@hailin0 @Hisoka-X @EricJoy2048 PTAL,thanks |
@@ -139,7 +130,7 @@ private SeaTunnelRowType initTableField(Connection conn) { | |||
ArrayList<String> fieldNames = new ArrayList<>(); | |||
try { | |||
PreparedStatement ps = conn.prepareStatement(jdbcSourceOptions.getJdbcConnectionOptions().getQuery()); | |||
ResultSetMetaData resultSetMetaData = ps.getMetaData(); | |||
ResultSetMetaData resultSetMetaData = ps.executeQuery().getMetaData(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why need add executeQuery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
executeQuery has a great impact on the performance of other databases, it is recommended to use JdbcDialect to achieve
initialize = true; | ||
} | ||
|
||
public synchronized void write(RowPutChange rowPutChange) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no synchronized needed
} | ||
} | ||
|
||
public synchronized void close() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
seatunnel-dist/pom.xml
Outdated
<groupId>org.apache.seatunnel</groupId> | ||
<artifactId>connector-tablestore</artifactId> | ||
<version>${project.version}</version> | ||
<scope>provided</scope> </dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep the format
if (config.hasPath(TablestoreConfig.DEFAULT_BATCH_INTERVAL_MS)) { | ||
this.batchIntervalMs = config.getInt(TablestoreConfig.DEFAULT_BATCH_INTERVAL_MS); | ||
} | ||
if (config.hasPath(TablestoreConfig.PRIMARY_KEYS)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already checked in checkAllExists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add OptionRule reference #3337.
docs/en/connector-v2/sink/Jdbc.md
Outdated
- [Feature] Support DB2 JDBC Sink ([2410](https://github.com/apache/incubator-seatunnel/pull/2410)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add changed log
|
||
The primaryKeys of Tablestore. | ||
|
||
### common options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### common options | |
### common options [ config ] |
@EricJoy2048 @ic4y done. PTAL again,thanks. |
|
||
@Override | ||
public OptionRule optionRule() { | ||
return OptionRule.builder().required(END_POINT, TABLE, INSTANCE_NAME, ACCESS_KEY_ID, ACCESS_KEY_SECRET, PRIMARY_KEYS, SeaTunnelSchema.SCHEMA).build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lost the option options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lost the option options?
What is the meaning of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done . @EricJoy2048 @ic4y
.../main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreConfig.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreConfig.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreConfig.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreConfig.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreOptions.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreOptions.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreOptions.java
Outdated
Show resolved
Hide resolved
...main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreOptions.java
Outdated
Show resolved
Hide resolved
…/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreConfig.java Co-authored-by: Eric <gaojun2048@gmail.com>
…/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreConfig.java Co-authored-by: Eric <gaojun2048@gmail.com>
…/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreConfig.java Co-authored-by: Eric <gaojun2048@gmail.com>
…/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreOptions.java Co-authored-by: Eric <gaojun2048@gmail.com>
…/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreConfig.java Co-authored-by: Eric <gaojun2048@gmail.com>
…/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreOptions.java Co-authored-by: Eric <gaojun2048@gmail.com>
…/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreOptions.java Co-authored-by: Eric <gaojun2048@gmail.com>
…/apache/seatunnel/connectors/seatunnel/tablestore/config/TablestoreOptions.java Co-authored-by: Eric <gaojun2048@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
Purpose of this pull request
The tablestore source connector reuse JDBC connector.
Check list
New License Guide